﻿#Include ..\baseHandle.ahk

class Open extends BaseHandle {

  static Handle(parsed) {
    cfs := MeowConf.Of('./cfg/openFile.txt')
    if res := cfs.Get(t := parsed.target) {
      Run res
      return this.Succ('ok', 'x')
    }
    return this.Fail(t ' not found')
  }

    static Spec() {
    return {
      cmd: 'open',
      desc: '打开配置项',
      format: 'open <target>',
      args: {
        desc: '',
        isOptional: false,
        cacheable: true,
        generator: {
          script: '',
          postProcess: (*) => MeowConf.Of('./cfg/openFile.txt').data.keys
        }
      },
      extra: {
        isEnable: false
      }
    }
  }

}
